<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
	<script>
		function reportToExcel()
		{	
			var params=${gatewayid}+","+${sensorid}+","+${channelid};
			var startTime=$("#startTime").val();
			var endTime2=$("#endTime2").val();
			params=params+","+startTime+","+endTime2;
			/* $(".time").each(function(){
     				alert($(this).text());
 			}); */
 			var paramsTime="";
 			$("li").each(function(){
    			//alert($(this).text());
    			if($(this).index()==0)
    			{
    				paramsTime=paramsTime+$(this).text();
    			}
    			else
    			{
    				paramsTime=paramsTime+"#"+$(this).text();
    			}
  			});
  			params=params+"@"+paramsTime;
 			
			$.ajax({
				type : 'POST',
				contentType : 'application/json',
				url : 'reportToExcel.shtml',
				data : params,
				dataType : 'json',
				success : function(data) {
					dialog_alert("导出成功");
				},
				error : function(data) {
					dialog_alert("导出失败");				
					//dialog_alert("页面过期，请重新登录！");
				}
			});
		}
    </script>
	<!-- 基础运营报表 -->
	<span>
	   <div style=" width:900px; height:500px;">
	      <div class="centerBox structureTitle">
	      	${gatewayid}_${sensorid}_${channelid}&nbsp;&nbsp;&nbsp;(${startTime}~${endTime2})
	      	<input id="startTime" type="hidden" value="${startTime}" />
	      	<input id="endTime2" type="hidden" value="${endTime2}" />
	      	<input id="fileName" type="hidden" value="${fileName}" />
	      	<a href="${cdnctx}/economicBenefit/fileDownload.shtml?filename=${fileName}"><button aligen="right" valign='right'>导出到Excel</button></a>
			<%-- <input type="text"  size="30" class="structureTitle" value="${dateInterval_report}" /> --%>		
	      </div>
	      <div class="winContent" style=" max-height:495px;overflow:auto;">
	      	<div style=" margin-top:0px; border:1px solid #dce7f0">
			   	<table width="700px" border="0" align="center" cellpadding="0" cellspacing="0" class="formTable"> 
			   		<thead>
			   			<tr>
							<td align='center' valign='middle'>时间段</td>
							<td align='center' valign='middle'>累计时间(分钟)</td>
							<td align='center' valign='middle'>状态</td>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${periodOfTime}" var="time" varStatus="status">
							<tr>
								<!--  <li type="hidden" style="display:none;">${time}</li> -->	
								<td  calss="time" align='center' valign='middle' >${time.stime}</td>
								<td  calss="time" align='center' valign='middle' style="width:200px">${time.etime}</td>
								<td  align='center' valign='middle' >点亮</td>
							</tr>
						</c:forEach>
					</tbody>
			  	</table>
			  	
	   		</div>
	   	  </div>
	   </div>
	</span>